import React, { Component } from 'react'
import { Button } from 'antd-mobile'
import PubSub from "pubsub-js"

class MyPubSub extends Component {
    constructor(props) {
        super(props)
    }
    state = {}

    pub() {
        PubSub.publish('send', 'data')
    }

    render() {
        return (
            <div>
                <Button onClick={this.pub}>我是发布消息的组件</Button>
            </div>
        )
    }
}
export default MyPubSub